<!DOCTYPE html>
<html xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
		<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
			<#if shiro.hasPermission("sys:goods:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("sys:goods:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("sys:goods:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
														                    <div class="form-group">
                        <div class="col-sm-2 control-label">产品代码</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="goods.code" placeholder="产品代码"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">产品名称</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="goods.name" placeholder="产品名称"/>
                        </div>
                    </div>


                    <div class="form-group">
                        <div class="col-sm-2 control-label">品牌</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="goods.brand" placeholder="品牌"/>
                        </div>
                    </div>



                    <div class="form-group">
                        <div class="col-sm-2 control-label">生产日期</div>
                        <div class="col-sm-10">
                            <input type="text" class="layui-input" id="test1" v-model="goods.createTime" placeholder="生产日期"/>
                        </div>
                    </div>


											                    <div class="form-group">
                        <div class="col-sm-2 control-label">保质期</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="goods.exp" placeholder="保质期"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">产地</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="goods.describies" placeholder="产地"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">检测信息</div>
                        <div class="col-sm-10">
                            <select name="public-choice" class="form-control" v-model="goods.checkInfo" @change="getCouponSelected">
                                <option :value="coupon.name" v-for="coupon in couponList">{{coupon.name}}</option>
                            </select>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">备注</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="goods.remark" placeholder="备注"/>
                        </div>
                    </div>
							            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" id="btnSaveOrUpdate" data-loading-text="保存中..." @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#test1' //指定元素
        });
    });
</script>
<script src="${request.contextPath}/statics/js/modules/sys/goods.js?_${.now?long}"></script>
</body>
</html>